package com.zzhua.client1;

import org.springframework.security.core.Authentication;
import org.springframework.security.core.context.SecurityContextHolder;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Arrays;


@RestController
public class HaloController {
    @CrossOrigin
    @GetMapping("/halo")
    public String halo() {
        Authentication authentication = SecurityContextHolder.getContext().getAuthentication();
        System.out.println(authentication.getName() + Arrays.toString(authentication.getAuthorities().toArray()));
        return "halo-1111";
    }
}
